//
//  Network.m
//  aiteshangcheng
//
//  Created by caominglei on 2018/4/19.
//  Copyright © 2018年 aite. All rights reserved.
//

#import "Network.h"
#import "HttpTool.h"
//#import "APIConfig.h"
//#import "Config.h"
//#import "InstoreModel.h"

@implementation Network

+ (void)executeGetDelivery_inform_listTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json){
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            
            NSDictionary *dict = (NSDictionary *)json[@"datas"][@"list"];
            success(dict);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
    }];
}
+ (void)executeGetStoragelistTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json){
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            
            NSDictionary *dict = (NSDictionary *)json[@"datas"][@"list"];
            success(dict);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
    }];
}

+ (void)executeGetNotInStoragelistTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json){
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
    }];
}

+ (void)executeGetConsumerslistTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json){
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
    }];
}

+ (void)executePostSignTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);

    }];
}

+ (void)executeGetNoteDelivery_tallyTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);

    }];
}

+ (void)executePostDelivery_CompanyTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executePostDelivery_tally_updateTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}


+ (void)executeGetVIPTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);

    }];
}

+ (void)executePostincomeTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executeGetChargeListTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed

{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executeGetConsumerListTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executeGetdelivery_costListTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executePostAddDelivery_costTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executePostEditDelivery_costTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executePostSms_numTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executeGetSendSms_statusTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executePostDelivery_order_stateTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}
+ (void)executePostelivery_sms_payTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

+ (void)executeGetDelivery_CompanyLisTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
    }];
}

+ (void)executePostAnalizseDataLisTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
    }];
}

+ (void)executeGetsms_template_listTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
    }];
}

+ (void)executePostWithdrawTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}
+ (void)executePostLoginOutTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}
+ (void)executeGetRcb_log_lisTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];

}

+ (void)executePetrechargecard_addTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}


+ (void)executeRecharge_delTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}
+ (void)executeGetPredepositTaskWithUrl:(NSString *)url Dict:(NSDictionary *)dict Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool getWithPath:url params:dict success:^(id json) {
        if ([json[@"code"] integerValue] == 200) {//如果返回数据正确，要数据解析
            success(json);
        }else{
            failed(json);
        }
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}
@end
